Skip to content

feat(accounts): add getTokensPnlHistory endpoint to retrieve token Pn…#105

Merged
ifaouibadi merged 2 commits intodevelopfrom
features/fix-large-pnl-response-obj
Apr 2, 2026
Merged

feat(accounts): add getTokensPnlHistory endpoint to retrieve token Pn…#105
ifaouibadi merged 2 commits intodevelopfrom
features/fix-large-pnl-response-obj

Conversation

@ifaouibadi
Copy link
Copy Markdown
Member

@ifaouibadi ifaouibadi commented Apr 2, 2026

…L history with optional date range and interval; enhance portfolio service to support per-token PnL breakdown


Note

Medium Risk
Adds a new public API route that can return significantly larger payloads and slightly changes getPortfolioHistory behavior via a new includeTokensPnl option, so there’s moderate risk of performance/regression issues in portfolio history responses.

Overview
Adds a new GET :address/portfolio/tokens/history endpoint that always includes PnL and can return per-token PnL breakdowns (tokens_pnl), with optional range-based PnL via include=pnl-range.

Extends PortfolioService.getPortfolioHistory with an includeTokensPnl flag so the existing portfolio history endpoint can keep returning only aggregate PnL unless explicitly requested, and updates Swagger/docs (GetPortfolioHistoryQueryDto, PortfolioHistorySnapshotDto, controller @ApiOperation) to clarify include semantics and where tokens_pnl is available.

Written by Cursor Bugbot for commit c09710f. This will update automatically on new commits. Configure here.

…L history with optional date range and interval; enhance portfolio service to support per-token PnL breakdown
Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

…maries and descriptions; update query DTO for clarity on included fields
@ifaouibadi ifaouibadi merged commit 38588cb into develop Apr 2, 2026
2 checks passed
@ifaouibadi ifaouibadi deleted the features/fix-large-pnl-response-obj branch April 2, 2026 07:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant